const path = require('path');

/**
 * path.extname(path):
 * 
 *      1. usage: returns the extension of the path, from the last occurrence of the . character
 *                 to end of string in the last portion of the path. If there is no . in the last
 *                  portion of the path, or if there are no . character other than the first character
 *                  of the basename of path, an empty string is returned.
 * 
 */

path.extname('index.html');
// returns : '.html'

path.extname('index.coffe.md');
// returns : '.md'

path.extname('index.');
// returns : '.'

path.extname('index');
// returns : ''

path.extname('.index');
// returns : ''

path.extname('.index.md');
// returns : '.md'

// A TypeError is thrown if path is not a string.